<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.longtop.com/intelliweb" prefix="e"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Insert title here</title>
	</head>

	<e:View id="view">
		<script type="text/javascript" src="<c:url value='/scripts/global.js'/>"></script>
		<script type="text/javascript" src="<c:url value='/scripts/skin.js'/>"></script>
	    <script type="text/javascript">SkinUtil.getSkin();</script>
	    <script type="text/javascript">SkinUtil.getModuleSkin();</script>
    
		<div id="Invisual Controls" style="min-height: 40px; background-color: LemonChiffon;" >
			<e:Dataset id="Dataset_DsAcct" datasetDefinition="DatasetDefinition_fp.dsd" datasetRef="Dataset_DsAcct" pageSize="10" loadDataCommand="Command_Load">
				<e:Field name="acctId" dataType="string" label="账户号" maxLength="" />
				 <e:Field name="bizCode" dataType="string" label="业务代号" maxLength="" />
				 <e:Field name="bizDate" dataType="string" label=" 数据业务日期" maxLength="" />
				 <e:Field name="currency" dataType="string" label="币种" maxLength="" />
				 <e:Field name="custId" dataType="string" label="客户号" maxLength="" />
				 <e:Field name="custName" dataType="string" label="客户名称" maxLength="" />
				 <e:Field name="openOrgId" dataType="string" label="开户机构Id" maxLength="" visible="false"/>
				 <e:Field name="openOrgName" dataType="string" label="开户机构名称" maxLength="" />
				 <e:Field name="openUserId" dataType="string" label="开户柜员Id" maxLength="" visible="false"/>
				 <e:Field name="openUserName" dataType="string" label="开户柜员名称" maxLength="" />
				 <e:Field name="openDate" dataType="date" label="开户时间" maxLength="" />
				 <e:Field name="rate" dataType="double" label="利率" maxLength="" />
				 <e:Field name="simProfit" dataType="double" label="虚拟利润" maxLength="" />
				 <e:Field name="acctType" dataType="String" label="账户类型" maxLength="" />
			</e:Dataset>
			
			<e:Command id="Command_Search" action="com.longtop.perform.fp.web.DsAcctListAction" method="searchAcct" submitForm="true" submitFormScope="all" validateRequired="true">
				<e:DatasetInfo name="DatasetInfo2" dataset="Dataset_DsAcct" alwayRefreshClient="true" submitType="all"></e:DatasetInfo>
				<e:Parameter name="assignId"></e:Parameter>
			</e:Command>
			<e:Command id="Command_Load" action="com.longtop.perform.fp.web.DsAcctListAction" method="loadAcct" showHintInfoOnSuccess="false">
				<e:DatasetInfo name="DatasetInfo3" dataset="Dataset_DsAcct" alwayRefreshClient="true"></e:DatasetInfo>
			</e:Command>
			
			<e:LookupDropDown id="LookupDropDown_Org" path="/jsp/framework/sys/org/orgDropdown.jsp"	windowWidth="600" windowHeight="400" 
					autoDropDown="true" fixed="true" onSelect="LookupDropDown_Org_onSelect(dropdown,iframe,text)" windowCaption="选择开户机构">
			</e:LookupDropDown>
			<e:LookupDropDown id="LookupDropDown_User" path="/jsp/framework/sys/user/userDropdown.jsp"	windowWidth="600" windowHeight="400" 
					autoDropDown="true" fixed="true" onSelect="LookupDropDown_User_onSelect(dropdown,iframe,text)" windowCaption="选择开户柜员">
			</e:LookupDropDown>
			
			<e:ListDropDown id="LookupDropDown_AcctType" fixed="true" autoDropDown="true">
				<e:ListDropDownItem name="ListDropDownItem1" label="存款" value="1"></e:ListDropDownItem>
				<e:ListDropDownItem name="ListDropDownItem2" label="贷款" value="2"></e:ListDropDownItem>
			</e:ListDropDown>
			
		</div>

		<body>
			<e:Page id="ePage" action="com.longtop.perform.fp.web.DsAcctListAction" style="min-height: 80px; width: 100%; height: 100%;" onAfterLoadPage="ePage_onAfterLoadPage()">
				<table style="width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
					<tr>
						<td valign="top" width="100%">
							<table style="text-align: left; width: 100%;" border="0" cellpadding="3" cellspacing="3" >
								<tr>
									<td>
										<e:GroupBox id="GroupBox1" caption="客户查询" style="height: 100%; width:100%;">
											<table style="text-align: left; width: 100%;" border="0" cellpadding="3" cellspacing="3" width="100%" align="center">
												<tr>
													<td align="right" nowrap="nowrap">
														<e:Label id="Label_acctId" caption="账户号"></e:Label>
													</td>
													<td align="left">
														<e:Text id="Text_acctId" style="width:100px;"></e:Text>
													</td>
													<td align="right" nowrap="nowrap">
														<e:Label id="Label_acctType" caption="账户类型"></e:Label>
													</td>
													<td align="left">
														<e:Text id="Text_acctType" style="width:100px;" dropDown="LookupDropDown_AcctType"></e:Text>
													</td>
													<td align="right" nowrap="nowrap">
														<e:Label id="Label_custId" caption="客户号"></e:Label>
													</td>
													<td align="left">
														<e:Text id="Text_custId" style="width:100px;"></e:Text>
													</td>
												</tr>
												<tr>
													<td align="right" nowrap="nowrap">
														<e:Label id="Label_custName" caption="客户名称"></e:Label>
													</td>
													<td align="left">
														<e:Text id="Text_custName" style="width:100px;"></e:Text>
													</td>
													<td align="right" nowrap="nowrap">
														<e:Label id="Label_openOrg" caption="开户机构"></e:Label>
													</td>
													<td align="left">
														<e:Text id="Text_openOrg" style="width: 100px" dropDown="LookupDropDown_Org"></e:Text>
													</td>
													<td align="right" nowrap="nowrap">
														<e:Label id="Label_openUser" caption="开户柜员"></e:Label>
													</td>
													<td align="left">
														<e:Text id="Text_openUser" style="width: 100px" dropDown="LookupDropDown_User"></e:Text>
													</td>
													<td align="left" width="99%">
														<e:Button id="Button_Search" style='height: 22px; width: 70px' caption="查询" command="Command_Search" icon="/images/query.gif" onClick="Button_Search_onClick()"></e:Button>
													</td>
												</tr>
											</table>
										</e:GroupBox>
									</td>
								</tr>	
								<tr>
									<td>
										<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td height="27px" width="1%">
													<e:RecordNavigator id="RecordNavigator_Acct" dataset="Dataset_DsAcct" showNavigatorButton="false">
														<e:RecordButton id="RecordButton_acctAssign" label="分配业绩" icon="/images/edit.gif" onClick="RecordButton_acctAssign_onClick()"></e:RecordButton>
													</e:RecordNavigator>
												</td>
												<td align="left" width="99%"><e:PageNavigator id="PageNavigator_Acct" dataset="Dataset_DsAcct" showRecordNum="true"></e:PageNavigator></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td>
										<e:Grid id="Grid_Acct" style="width: 100%; height: 100%;" showIndex="true" readOnly="true" dataset="Dataset_DsAcct" onClick="Grid__Acct_onClick()">
										</e:Grid>
									</td>
								</tr>
							</table>
						</td>
					</tr>
			    </table>
			</e:Page>
		</body>
	</e:View>
</html>	

<script type="text/javascript">
	//init
	function ePage_onAfterLoadPage(){
	}
	
	//查询
	function Button_Search_onClick(){
	    Command_Search.execute();
	}
	//Text选择所属机构
	function LookupDropDown_Org_onSelect(dropdown,iframe,text){
		var dataset = $J(iframe.Dataset_Org);
		var node = $J(iframe.DataTree_Org).getCurrentNode();
		if(dataset && node!=null&& node.level > 1){//除去根节点
		    var record = dataset.getCurrentRecord();
		    if(typeof record != "undefined" && record != null){
		    	$J("Text_openOrg").setValue(record.getValue("orgId"),record.getValue("orgName"));
		    }
		}
		if(dataset && node!=null && node.level == 1){//清空
			$J("Text_openOrg").setValue("");
		}
	}
	//选择开户柜员
	function LookupDropDown_User_onSelect(dropdown,iframe,text){
		var dataset = $J(iframe.Dataset_User);
		if(dataset){
		    var record = dataset.getCurrentRecord();
		    if(typeof record != "undefined" && record != null){
		    	$J("Text_openUser").setValue(record.getValue("userId"),record.getValue("userName"));
		    }
		}
	}
	//分配业绩
	function RecordButton_acctAssign_onClick(){
		var record = Dataset_DsAcct.getCurrentRecord();
		if(record){
			var id = record.getValue("acctId");
			if(id != null && id != ''){
				var path = "/jsp/perform/fp/dsAcctAssignList.jsp?acctId="+id;
				parent.TabUtil.openTab("dsAcctAssign","对私账户分配业绩",path,true);
			}
		}
	}
	
		
</script>